<div class="pane2-meta">
  <div class="title">Teams</div>
</div>
<% assignables = Team.assignable_by_user(current_user).collect(&:id) %>
<div class="pane2-content">
  <%# if defined? project %>
  <%#= link_to 'New team', new_project_team_path(project), :remote => false, :class => 'dashed_link transition' %>
  <%# else %>
  <%#= link_to 'New team', new_team_path, :remote => false, :class => 'dashed_link transition' %>
  <%# end %>
  <% teams.each do |team| %>
      <div class="card-transparent transition team-card team-<%= team.id %>">
        <div class="team-name">
          <%= link_to team.name, team_path(team), :class => 'grey-link' %>
        </div>
        <div class="team-glymplse">
          <%= "#{team.members_count} #{'Member'.pluralize(team.members_count)}" %>
        </div>
        <div class="team-glymplse">
          <%= link_to team.project.name, project_path(team.project_id), :class => 'team-project' %>
          <% if assignables.include?(team.id) %>
              <%= link_to 'Add task', new_task_path(:team_id => team.id), :remote => false, :class => 'btn btn-sec right' %>
          <% end %>
        </div>
      </div>
  <% end %>
</div>